using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Viettel.VOFFICE.DAO.Models.Mapping
{
    public class UserVoiceMap : EntityTypeConfiguration<UserVoice>
    {
        public UserVoiceMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Contents)
                .IsRequired()
                .HasMaxLength(500);

            this.Property(t => t.ReplyContents)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("UserVoice");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Contents).HasColumnName("Contents");
            this.Property(t => t.CreatedAt).HasColumnName("CreatedAt");
            this.Property(t => t.UpdatedAt).HasColumnName("UpdatedAt");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
            this.Property(t => t.ReplyContents).HasColumnName("ReplyContents");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
        }
    }
}
